﻿using KM.Framework.Business;
using KM.Framework.Utility;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Sale.Client
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window
    {
        private MainWindowViewModel ViewModel;
        public MainWindow()
        {
            InitializeComponent();
            this.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            this.DataContext = ViewModel = new MainWindowViewModel();
            this.Closed += (s, e) =>
            {
                Process[] app = Process.GetProcessesByName("Sale.Client");
                if (app != null && app.Length > 0)
                {
                    foreach (var item in app)
                        item.Kill();
                }
            };
        }
        //private void dataPager_PageChanged(object sender, KM.Framework.Business.PageChangedEventArgs args)
        //{
        //    ViewModel.Query(args.PageSize, args.PageIndex);
        //}
    }
}
